﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="new_registerNew.aspx.cs" Inherits="huaguwang.virtualWeb.user.new_registerNew" %>
<%@ Register src="../uc/user/footer.ascx" tagname="footer" tagprefix="uc1" %>
<%@ Register src="../uc/header.ascx" tagname="header" tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="x-ua-compatible" content="ie=7" /> 
    <title>新会员免费注册</title>
    <link href="../CSS/css_global.css" rel="stylesheet" type="text/css" />
    <link href="../css/css_header_footer.css" rel="stylesheet" type="text/css" />
    <link href="../css/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/css_register.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.validationEngine.js" type="text/javascript"></script>
    <script type="text/javascript">
        var imgA = 0;
        function funcXM() {
            $.ajaxSetup({
                async: false
            });
            var blnSS = "资料错误";
            $.getJSON("/user/userfunction.aspx?stype=1", { p1: $("#txtName").attr("value"), p2: "test" }, function(json) {
                if (json.success == "False") {
                    blnSS = json.Msg;
                } else {
                    blnSS = "";
                }
            });
            $.ajaxSetup({
                async: true
            });
            return blnSS;
        }
        function funcYZ() {
            $.ajaxSetup({
                async: false
            });
            var blnSS = "资料错误";
            var sss = $.getJSON("/public/CreateValidate.aspx?stype=code&name=mLogin&r=", function(json) {
                var v = json["Msg"].toLowerCase();
                var txtV = $("#txtYZ").attr("value") || "";
                txtV = txtV.toLowerCase();
                if (v != txtV) {
                    blnSS = "验证码不正确!";
                } else {
                    blnSS = "";
                }
            });
            $.ajaxSetup({
                async: true
            });
            return blnSS;
        }
        $(function() {
            $("#form1").validationEngine({ promptPosition: "centerRight", returnIsValid: false, validationEventTriggers1: "" });
            $("#spanRef").click(function() {
                imgA++;
                $("#verifycode").attr("src", "/public/CreateValidate.aspx?stype=img&name=mLogin&r=" + imgA);
            });
            $("#sub_reg").click(function() {
                if ($("#form1").validationEngine({ promptPosition: "centerRight", returnIsValid: true, validationEventTriggers1: "" })) {

                    $.getJSON("/user/userfunction.aspx?stype=1", { p1: $("#txtName").val(), p2: $("#txtP1").val() }, function(json) {
                        if (json.success == "False") {
                            alert(json.Msg);
                        } else {
                            location.replace("new_register_callback.aspx?msg=" + json.Msg);
                        }
                    });
                };
            });

        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="headerBG top">
            <uc2:header ID="header1" runat="server" />
        </div>
        <div class="container">
            <div id="logo">
                <img src="../images/logo.gif"/>
            </div>
            <div id="red_septal_red" class="clear">
                <h1 class="title">1.请填写会员信息</h1><h2 class="title_script">(以下均为必填)</h2>
            </div>
            <div id="content_BG">
                <div id="content">
                    <ul class="out_per60" style="margin-top:60px;margin-left:40px;">
                        <li>
                            <label>会员名：</label>
                            <input name="username" id="txtName" type="text" class="validate[required,length[3,20],ajaxFunc[funcXM]] input_txt"
                            validatemsg="2-30个字符或数字!" />
                        </li>
                        <li>
                            <label>登录密码：</label>
                            <input type="password" id="txtP1" class="validate[required,length[3,20]] input_txt"
                            validatemsg="2-30个字符或数字!" />
                        </li>
                        <li>
                            <label>确认密码：</label>
                            <input name="password_again" id="password_again" type="password" class="validate[required,confirm[txtP1]] input_txt"  validatemsg="请重复输入登录密码!"/>
                        </li>
                        <li>
                            <label>验证码：</label>
                            <a class="font_12" color="#3366cc" id="spanRef" style="cursor: pointer" title="看不清，换一张？">
                                <img id="verifycode" align="absmiddle" src="/public/CreateValidate.aspx?stype=img&name=mLogin" />
                            </a>&nbsp;
                            <input id="txtYZ" style="width: 85px" class="validate[required,ajaxFunc[funcYZ]]] input_txt"
                                validatemsg="请输入正确的验证码!" />
                        </li>
                        <li><asp:Button ID="Button1" runat="server" CssClass="btn_register" /></li>
                        <li><span style="margin-left:-15px;"><a href=""><font color="#3366cc">《华股网服务条款》</font></a></span></li>
                    </ul>
                </div>
                <div id="ad">
                    <img src="../images/login_register/new_register_AD.gif" />
                </div>
            </div>
            <div id="footer">
                <uc1:footer ID="footer1" runat="server" />
            </div>
        </div>
    </form>
</body>
</html>
